/**
 * Copyright (C)  Gadglet .
 *
 * This file is part of Gadglet
 *
 * Gadglet is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gadglet is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Gadglet. If not, see <http://www.gnu.org/licenses/>.
 */
package com.gadglet.data;

import java.util.Date;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


/**
 * Persistence class for Minglets Friends-Invitation
 *
 */

@PersistenceCapable
 public class FriendsInvitation {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String invitationId;

	
	@Persistent
	private String invitedBy;
	
	@Persistent
	private String sendTo;
	
	@Persistent
	private Date creation;
	
	
	@Persistent
	private String container;

	
	
	/**
	 * This constructor is used when both users has Active profiles
	 * @param invitedBy - user inviting 
	 * @param sendTo - user invited
	 */
	public FriendsInvitation( String invitedBy, String sendTo) {
		
		this.invitedBy = invitedBy;
		this.sendTo = sendTo;
		this.creation = new Date();
	}
	
	
	/**
	 * This constructor is used when user with Profile send a request to user without a profile 
	 * @param invitedBy
	 * @param sendTo
	 * @param container
	 */
	public FriendsInvitation( String invitedBy, String sendTo,
			 String container) {
		
		this.invitedBy = invitedBy;
		this.sendTo = sendTo;
		this.creation = new Date();
		this.container = container;
	}
	
	
	public String getInvitationId() {
		return invitationId;
	}
	
	public String getInvitedBy() {
		return invitedBy;
	}



	public String getSendTo() {
		return sendTo;
	}



	public Date getCreation() {
		return creation;
	}



	public String getContainer() {
		return container;
	}
	
	
}
